package com.security.frame.core;

import com.security.frame.core.code.ValidateCode;
import com.security.frame.core.enums.ValidateCodeType;
import org.springframework.web.context.request.ServletWebRequest;

/**
 * todo
 *
 * @author wangjie
 * @version V1.0
 * @date 2019/11/28
 */
public interface ValidateCodeRepository {
    /**
     * 保存验证码
     * @param request
     * @param code
     * @param type
     */
    void save(ServletWebRequest request, ValidateCode code, ValidateCodeType type);

    /**
     * 获取验证码
     * @param request
     * @param type
     * @return
     */
    ValidateCode get(ServletWebRequest request, ValidateCodeType type);

    /**
     * 移除验证码
     * @param request
     * @param type
     */
    void remove(ServletWebRequest request, ValidateCodeType type);
}
